package com.biconn.bigdata.es.model;

import org.springframework.data.annotation.Id;

import com.alibaba.fastjson.annotation.JSONField;
import com.biconn.bigdata.common.util.JsonUtil;
import com.biconn.bigdata.es.client.config.AnalyzedEnum;
import com.biconn.bigdata.es.client.config.StoreEnum;
import com.biconn.bigdata.es.client.config.TypeEnum;
import com.biconn.bigdata.es.client.config.annontation.IndexAnnontation;
import com.biconn.bigdata.es.client.config.annontation.IndexFileAnnontation;

@IndexAnnontation(indexName = "question_and_answer_index",typeName = "questionAndAnswer",number_of_replicas="1" , number_of_shards="3")
public class QuestionAndAnswer {
	
	 /**爬虫问答数据ES结构 */
	@SuppressWarnings("unused")
	private static final long serialVersionUID = 1L;
	
	/**id**/
	
	@Id
	private Long id;
	
	 /**问题标题**/
	@JSONField(name="ask_title")
	@IndexFileAnnontation(name="askTitle", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE )
	private String questionTitle;
	
	 /**问题内容**/
	@JSONField(name="ask_content")
	@IndexFileAnnontation(name="askContent", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.TRUE , analyzer = "ik_max_word" , search_analyzer = "ik_smart")
	private String questionContent;
	//@IndexFileAnnontation(type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.TRUE , analyzer = "ik_max_word" , search_analyzer = "ik_smart")
	
	 /**问题内容涉及的疾病科室**/
	@JSONField(name="ask_department")
	@IndexFileAnnontation(name="askDepartment", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.TRUE , analyzer = "ik_max_word" , search_analyzer = "ik_smart")
	private String questionDepartment;
	
	 /**问题内容爬取地址**/
	@JSONField(name="ask_link")
	@IndexFileAnnontation(name="askLink", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String questionUrl;
	
	 /**问题内容数据来源**/
	@JSONField(name="source_web")
	@IndexFileAnnontation(name="sourceWeb", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String questionSource;
	
	 /**客户性别**/
	@JSONField(name="ask_sex")
	@IndexFileAnnontation(name="askSex", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String customerSex;
	
	 /**客户年龄**/
	@JSONField(name="ask_age")
	@IndexFileAnnontation(name="askAge", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String customerAge;
	
	 /**医生回复**/
	@JSONField(name="answers")
	@IndexFileAnnontation(name="answers", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String answerContent;
	
	/**询问时间**/
	@JSONField(name="ask_id")
	@IndexFileAnnontation(name="askId", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String questionId;
	
	 /**创建时间**/
	@JSONField(name="ask_time")
	@IndexFileAnnontation(name="askTime", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String createTime;
	
	/**ask_content md5签名**/
	@JSONField(name="ask_content_md5")
	@IndexFileAnnontation(name="askContentMd5", type = TypeEnum.TEXT,store = StoreEnum.TRUE,index = AnalyzedEnum.FALSE)
	private String askContentMd5;
	
	public Long getId() {
		return id;
	}
	public String getAskContentMd5() {
		return askContentMd5;
	}
	public void setAskContentMd5(String askContentMd5) {
		this.askContentMd5 = askContentMd5;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getQuestionTitle() {
		return questionTitle;
	}
	public void setQuestionTitle(String questionTitle) {
		this.questionTitle = questionTitle;
	}
	public String getQuestionContent() {
		return questionContent;
	}
	public void setQuestionContent(String questionContent) {
		this.questionContent = questionContent;
	}
	public String getQuestionDepartment() {
		return questionDepartment;
	}
	public void setQuestionDepartment(String questionDepartment) {
		this.questionDepartment = questionDepartment;
	}
	public String getQuestionUrl() {
		return questionUrl;
	}
	public void setQuestionUrl(String questionUrl) {
		this.questionUrl = questionUrl;
	}
	public String getQuestionSource() {
		return questionSource;
	}
	public void setQuestionSource(String questionSource) {
		this.questionSource = questionSource;
	}
	public String getCustomerSex() {
		return customerSex;
	}
	public void setCustomerSex(String customerSex) {
		this.customerSex = customerSex;
	}
	public String getCustomerAge() {
		return customerAge;
	}
	public void setCustomerAge(String customerAge) {
		this.customerAge = customerAge;
	}
	public String getAnswerContent() {
		return answerContent;
	}
	public void setAnswerContent(String answerContent) {
		this.answerContent = answerContent;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getQuestionId() {
		return questionId;
	}
	public void setQuestionId(String questionId) {
		this.questionId = questionId;
	}
	
	@Override
    public String toString() {
        return JsonUtil.objectToJson(this);
    }
	
}